#pragma once
#include "ClientSessionManager.h"
#include "boost/thread.hpp"
#include "boost/bind.hpp"


class ServerApp
{
public:
	ServerApp();
	static ServerApp &getInstance(){static ServerApp app; return app;}

	int Init();

	int Run();

	void Join();

	int Shutdown();

	void RegisterMessageHandler();

	void ExecuteTask();

public:
	int HandlePlayerLogon(const std::string &strMessage);

private:
	static void ThreadFunc(ServerApp *pServerApp);

private:
	boost::thread *m_pThreadHandleTask;
	bool m_bIsRun;

};

